<?php

        //$to 表示收件人地址 $subject 表示邮件标题 $body表示邮件正文
        //error_reporting(E_ALL);
        date_default_timezone_set("Asia/Shanghai");//设定时区东八区
        require_once('/email/class.phpmailer.php');
        include('/email/class.smtp.php');

        $mail = new PHPMailer(); //new一个PHPMailer对象出来
        $mail->CharSet = "UTF-8";//设定邮件编码，默认ISO-8859-1，如果发中文此项必须设置，否则乱码
        $mail->IsSMTP(); // 设定使用SMTP服务
        $mail->SMTPDebug = 0;                     // 启用SMTP调试功能
        // 1 = errors and messages
        // 2 = messages only
        $mail->SMTPKeepAlive = true;
        $smtpserver = "smtp.qq.com";
        $port = "465";
        $smtpuser = "781502032@qq.com";
        $smtppwd = "uqaunogydzpabbdi";

        $mail->SMTPAuth = true;                  // 启用 SMTP 验证功能

        //是否为安全链接
     
        $mail->SMTPSecure = "ssl";                 // 安全协议
     
        $mail->Host =$smtpserver;      // SMTP 服务器
        $mail->Port = $port;                   // SMTP服务器的端口号
        $mail->Username = $smtpuser;  // SMTP服务器用户名
        $mail->Password = $smtppwd;            // SMTP服务器密码
        $mail->SetFrom($smtpuser, "song");
        // $mail->AddReplyTo("281@qq.com", "邮件回复人的名称");
        $mail->Subject =  "验证邮件"; //邮件标题
        $mail->ishtml(true); 
        $mail->addembeddedimage('photo_1.jpg', 'photo_1', 'photo_1.jpg');
        $mail->Body = '你好, <b>朋友</b>! <br/>这是一封来自<a href="com" 
target="_blank">songzhilai</a>的邮件！我们还要做个邮箱激活，以及邮箱找回密码的功能<br/>
<img alt="helloweba" style="width:1600px;height:800px" src="cid:photo_1">';; //邮件内容
        $mail->AltBody = "www.song.com"; // optional, comment out and test
        /*$mail->AddAddress('song@aomai.com.au','songzhilai');*/
        $mail->AddAddress('496993798@qq.com','周英秋');

        //$address = $ary['to'];
/*		foreach($ary['people'] as $key => $val)
		{
			
			$mail->AddAddress($val['to'],$val['subject']);
			
		}*/
        //添加附件
        //$mail->AddAttachment(str_replace("\\","/",THINK_PATH) . 'Common/email/class.smtp.php');      // attachment
/*       if(is_array($ary['attachmentpath']))
	   {
		   //多个附件
		   foreach($ary['attachmentpath'] as $key =>$val)
		   {
			   $mail->AddAttachment($val); // attachment,附件地址
		   //$mail->AddAttachment($ary['attachmentpath'][1]); // attachment,附件地址
		   }
	   }
	   
       else
	   {
		   $mail->AddAttachment($ary['attachmentpath']); // attachment,附件地址
	   }*/
		//$mail->IsHTML(true);
        $status_eamil  =  $mail->Send();
    
        if (!$status_eamil) {
            echo "Mailer Error: " . $mail->ErrorInfo;
            //return array("error"=>0,"message"=>"Mailer Error: " . $mail->ErrorInfo);
        } else {
           echo $status_eamil."Message sent!恭喜，邮件发送成功！";
		  // return array("error"=>1,"Message sent!恭喜，邮件发送成功！"); 
        }

?>